package CCF_2013;

import java.util.Scanner;

public class T201312_2 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str1 = scanner.nextLine();
        scanner.close();
        String numStrings[] = str1.split("-");
        int sum = Integer.valueOf(numStrings[0]);
        for (int i = 0; i < 3; i++) {
            sum += numStrings[1].charAt(i) * (i + 2);
        }
        for (int i = 0; i < 5; i++) {
            sum += numStrings[2].charAt(i) * (i + 5);
        }
        int n = sum % 11;
        if (numStrings[3].equals(String.valueOf(n)) || (n == 10 && numStrings[3].equals("X")))
            System.out.println("Right");
        else {
            String s = (n == 10) ? "X": String.valueOf(n);
            System.out.println(numStrings[0] + "-" + numStrings[1] + "-" + numStrings[2] + "-" + s);
        }
    }
}
